home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 12810 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.0 KB  |  43 lines

  1. Newsgroups: comp.lang.c++
  2. Path: malgudi.oar.net!picker!news
  3. From: Kesheng Huo <kesheng@ct.picker.com>
  4. Subject: passing C function and its arguement
  5. Content-Type: text/plain; charset=us-ascii
  6. Message-ID: <3151AC6D.6E46@ct.picker.com>
  7. Sender: news@picker.com
  8. Nntp-Posting-Host: 144.54.49.43
  9. Content-Transfer-Encoding: 7bit
  10. Organization: Picker International, Inc.
  11. Mime-Version: 1.0
  12. Date: Thu, 21 Mar 1996 19:22:21 GMT
  13. X-Mailer: Mozilla 2.0 (X11; I; SunOS 5.4 sun4c)
  14.  
  15. I have a question about how to pass a C function with its 
  16. arguement to an object,
  17.  
  18. For example:
  19.  
  20. void foo(int agr1, int arg2);
  21. void foo1(float agr3, double arg4);
  22.  
  23. class myclass { 
  24.     public:
  25.            void FooInvokerHere(aFunc(int agr1, int arg2), ...)
  26.             { aFunc(arg1, arg2); }
  27. };
  28.  
  29. main()
  30. {
  31.      myclass a;
  32.      a.FooInvokerHere(foo, ??????) ;
  33.      a.FooInvokerHere(foo1, ?????) ;
  34. }
  35.  
  36. I knew I can pass a function pointer to take care foo, foo1, but 
  37. how to take care of those function arguements.
  38.  
  39. Any Hint, more than welcome.
  40.  
  41. Mike Huo
  42. email: kesheng@ct.picker.com
  43.